<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>应用宝盒 - 官方应用下载中心</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    <!-- Tailwind 配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#10B981',
                        accent: '#8B5CF6',
                        dark: '#1E293B',
                        light: '#F8FAFC'
                    },
                    fontFamily: {
                        inter: ['Inter', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .card-hover {
                @apply transition-all duration-300 hover:shadow-lg hover:-translate-y-1;
            }
            .text-gradient {
                @apply bg-clip-text text-transparent bg-gradient-to-r from-primary to-accent;
            }
            .scrollbar-hide::-webkit-scrollbar {
                display: none;
            }
            .scrollbar-hide {
                -ms-overflow-style: none;
                scrollbar-width: none;
            }
        }
    </style>
</head>
<body class="font-inter bg-gray-50 text-dark">
    <!-- 顶部通知栏 -->
    <div class="bg-primary text-white text-center py-2 text-sm">
        <p>📱 最新应用已更新至2025年8月版本</p>
    </div>

    <!-- 导航栏 -->
    <header id="navbar" class="bg-white shadow-sm sticky top-0 z-50 transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-2">
                <i class="fa fa-mobile text-3xl text-primary"></i>
                <h1 class="text-xl md:text-2xl font-bold text-gradient">应用宝盒</h1>
            </div>
            
            <nav class="hidden md:flex items-center space-x-8">
                <a href="#" class="font-medium hover:text-primary transition-colors">首页</a>
                <a href="#apps" class="font-medium hover:text-primary transition-colors">应用列表</a>
                <a href="#categories" class="font-medium hover:text-primary transition-colors">分类浏览</a>
                <a href="#stats" class="font-medium hover:text-primary transition-colors">下载统计</a>
                <a href="#disclaimer" class="font-medium hover:text-primary transition-colors">法律声明</a>
            </nav>
            
            <div class="flex items-center space-x-4">
                <button class="hidden md:block bg-primary hover:bg-primary/90 text-white px-4 py-2 rounded-full transition-all">
                    <i class="fa fa-search mr-1"></i> 搜索应用
                </button>
                <button id="mobile-menu-btn" class="md:hidden text-dark hover:text-primary">
                    <i class="fa fa-bars text-xl"></i>
                </button>
            </div>
        </div>
        
        <!-- 移动端菜单 -->
        <div id="mobile-menu" class="md:hidden hidden bg-white border-t">
            <div class="container mx-auto px-4 py-3 flex flex-col space-y-3">
                <a href="#" class="py-2 font-medium hover:text-primary transition-colors">首页</a>
                <a href="#apps" class="py-2 font-medium hover:text-primary transition-colors">应用列表</a>
                <a href="#categories" class="py-2 font-medium hover:text-primary transition-colors">分类浏览</a>
                <a href="#stats" class="py-2 font-medium hover:text-primary transition-colors">下载统计</a>
                <a href="#disclaimer" class="py-2 font-medium hover:text-primary transition-colors">法律声明</a>
                <div class="relative">
                    <input type="text" placeholder="搜索应用..." class="w-full px-4 py-2 rounded-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary/50">
                    <i class="fa fa-search absolute right-3 top-1/2 -translate-y-1/2 text-gray-400"></i>
                </div>
            </div>
        </div>
    </header>

    <main>
        <!-- 英雄区域 -->
        <section class="bg-gradient-to-br from-blue-50 to-purple-50 py-12 md:py-20">
            <div class="container mx-auto px-4">
                <div class="flex flex-col md:flex-row items-center">
                    <div class="md:w-1/2 mb-8 md:mb-0">
                        <h2 class="text-[clamp(2rem,5vw,3.5rem)] font-bold leading-tight mb-4">
                            安全下载<br>
                            <span class="text-gradient">热门手机应用</span>
                        </h2>
                        <p class="text-gray-600 text-lg mb-8 max-w-lg">
                            汇聚22款常用手机应用的官方最新版本，安全可靠，实时更新，一键获取官方最新资源。
                        </p>
                        <div class="flex flex-wrap gap-4">
                            <a href="#apps" class="bg-primary hover:bg-primary/90 text-white px-6 py-3 rounded-full font-medium transition-all shadow-lg hover:shadow-primary/30 flex items-center">
                                <i class="fa fa-download mr-2"></i> 浏览应用
                            </a>
                            <a href="#disclaimer" class="bg-white hover:bg-gray-100 text-dark px-6 py-3 rounded-full font-medium transition-all shadow-md hover:shadow-lg flex items-center">
                                <i class="fa fa-info-circle mr-2"></i> 法律声明
                            </a>
                        </div>
                    </div>
                    <div class="md:w-1/2 flex justify-center">
                        <div class="relative">
                            <img src="https://picsum.photos/seed/apps/600/400" alt="手机应用展示" class="rounded-xl shadow-2xl max-w-full h-auto">
                            <div class="absolute -bottom-4 -right-4 bg-secondary text-white p-4 rounded-lg shadow-lg animate-pulse">
                                <p class="font-bold">22+</p>
                                <p class="text-sm">官方应用</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- 法律声明预览 -->
        <section class="bg-white py-6 border-y border-gray-100">
            <div class="container mx-auto px-4">
                <div class="bg-amber-50 border border-amber-100 rounded-lg p-4 flex items-start">
                    <i class="fa fa-exclamation-circle text-amber-500 text-xl mt-0.5 mr-3"></i>
                    <p class="text-sm md:text-base text-gray-700">
                        <strong>声明：</strong> 本网站仅提供官方应用下载链接，不代表任何应用官方，所有下载资源均来自各应用官方网站。
                    </p>
                </div>
            </div>
        </section>

        <!-- 统计概览 -->
        <section id="stats" class="py-12 bg-white">
            <div class="container mx-auto px-4">
                <div class="text-center mb-12">
                    <h2 class="text-3xl font-bold mb-4">下载统计</h2>
                    <p class="text-gray-600 max-w-2xl mx-auto">实时展示平台应用下载数据统计，帮助您了解最受欢迎的手机应用</p>
                </div>
                
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-10">
                    <div class="bg-blue-50 rounded-xl p-6 text-center card-hover">
                        <div class="text-primary text-4xl mb-2">
                            <i class="fa fa-mobile"></i>
                        </div>
                        <h3 class="text-3xl font-bold mb-1" id="total-apps">22</h3>
                        <p class="text-gray-600">官方应用</p>
                    </div>
                    
                    <div class="bg-green-50 rounded-xl p-6 text-center card-hover">
                        <div class="text-secondary text-4xl mb-2">
                            <i class="fa fa-download"></i>
                        </div>
                        <h3 class="text-3xl font-bold mb-1" id="total-downloads">1,245,890</h3>
                        <p class="text-gray-600">总下载量</p>
                    </div>
                    
                    <div class="bg-purple-50 rounded-xl p-6 text-center card-hover">
                        <div class="text-accent text-4xl mb-2">
                            <i class="fa fa-refresh"></i>
                        </div>
                        <h3 class="text-3xl font-bold mb-1" id="today-updates">5</h3>
                        <p class="text-gray-600">今日更新</p>
                    </div>
                    
                    <div class="bg-orange-50 rounded-xl p-6 text-center card-hover">
                        <div class="text-orange-500 text-4xl mb-2">
                            <i class="fa fa-users"></i>
                        </div>
                        <h3 class="text-3xl font-bold mb-1" id="active-users">45,682</h3>
                        <p class="text-gray-600">活跃用户</p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-4 md:p-6">
                    <h3 class="text-xl font-semibold mb-4">下载趋势 (近30天)</h3>
                    <div class="h-80">
                        <canvas id="downloadChart"></canvas>
                    </div>
                </div>
            </div>
        </section>

        <!-- 分类浏览 -->
        <section id="categories" class="py-12 bg-gray-50">
            <div class="container mx-auto px-4">
                <div class="text-center mb-12">
                    <h2 class="text-3xl font-bold mb-4">按分类浏览</h2>
                    <p class="text-gray-600 max-w-2xl mx-auto">快速找到您需要的应用类型，所有应用均为官方最新版本</p>
                </div>
                
                <div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4">
                    <button class="category-btn bg-white rounded-xl p-4 text-center card-hover active" data-category="all">
                        <div class="w-12 h-12 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-3">
                            <i class="fa fa-th text-primary text-xl"></i>
                        </div>
                        <p class="font-medium">全部应用</p>
                    </button>
                    
                    <button class="category-btn bg-white rounded-xl p-4 text-center card-hover" data-category="social">
                        <div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-3">
                            <i class="fa fa-comments text-blue-500 text-xl"></i>
                        </div>
                        <p class="font-medium">社交通讯</p>
                    </button>
                    
                    <button class="category-btn bg-white rounded-xl p-4 text-center card-hover" data-category="shopping">
                        <div class="w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-3">
                            <i class="fa fa-shopping-cart text-green-500 text-xl"></i>
                        </div>
                        <p class="font-medium">购物支付</p>
                    </button>
                    
                    <button class="category-btn bg-white rounded-xl p-4 text-center card-hover" data-category="entertainment">
                        <div class="w-12 h-12 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-3">
                            <i class="fa fa-film text-purple-500 text-xl"></i>
                        </div>
                        <p class="font-medium">影音娱乐</p>
                    </button>
                    
                    <button class="category-btn bg-white rounded-xl p-4 text-center card-hover" data-category="tools">
                        <div class="w-12 h-12 bg-orange-100 rounded-full flex items-center justify-center mx-auto mb-3">
                            <i class="fa fa-wrench text-orange-500 text-xl"></i>
                        </div>
                        <p class="font-medium">工具实用</p>
                    </button>
                    
                    <button class="category-btn bg-white rounded-xl p-4 text-center card-hover" data-category="life">
                        <div class="w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-3">
                            <i class="fa fa-cutlery text-red-500 text-xl"></i>
                        </div>
                        <p class="font-medium">生活服务</p>
                    </button>
                </div>
            </div>
        </section>

        <!-- 应用列表 -->
        <section id="apps" class="py-12 bg-white">
            <div class="container mx-auto px-4">
                <div class="text-center mb-12">
                    <h2 class="text-3xl font-bold mb-4">热门应用下载</h2>
                    <p class="text-gray-600 max-w-2xl mx-auto">所有应用均为官方最新版本，点击即可前往官方下载页面</p>
                </div>
                
                <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
                    <!-- 应用卡片将通过JavaScript动态生成 -->
                </div>
                
                <!-- 加载更多按钮 -->
                <div class="text-center mt-10">
                    <button id="load-more" class="bg-white border border-primary text-primary hover:bg-primary hover:text-white px-6 py-3 rounded-full font-medium transition-all">
                        加载更多 <i class="fa fa-angle-down ml-1"></i>
                    </button>
                </div>
            </div>
        </section>

        <!-- 安全提示 -->
        <section class="py-12 bg-gradient-to-br from-gray-800 to-gray-900 text-white">
            <div class="container mx-auto px-4">
                <div class="flex flex-col md:flex-row items-center">
                    <div class="md:w-1/3 mb-8 md:mb-0">
                        <div class="bg-white/10 backdrop-blur-sm p-6 rounded-2xl">
                            <i class="fa fa-shield text-4xl text-primary mb-4"></i>
                            <h3 class="text-2xl font-bold mb-2">安全保障</h3>
                            <p class="text-gray-300">所有下载链接均指向官方网站，确保您获得的是安全、未经修改的应用程序。</p>
                        </div>
                    </div>
                    
                    <div class="md:w-1/3 mb-8 md:mb-0 md:px-8">
                        <div class="bg-white/10 backdrop-blur-sm p-6 rounded-2xl">
                            <i class="fa fa-clock-o text-4xl text-secondary mb-4"></i>
                            <h3 class="text-2xl font-bold mb-2">实时更新</h3>
                            <p class="text-gray-300">我们定期检查并更新所有应用的最新版本，确保您获取到的是最新资源。</p>
                        </div>
                    </div>
                    
                    <div class="md:w-1/3">
                        <div class="bg-white/10 backdrop-blur-sm p-6 rounded-2xl">
                            <i class="fa fa-balance-scale text-4xl text-accent mb-4"></i>
                            <h3 class="text-2xl font-bold mb-2">合规合法</h3>
                            <p class="text-gray-300">严格遵守相关法律法规，仅提供官方链接，不涉及任何侵权行为。</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- 法律声明 -->
        <section id="disclaimer" class="py-12 bg-gray-50">
            <div class="container mx-auto px-4">
                <div class="max-w-3xl mx-auto bg-white rounded-xl shadow-md p-6 md:p-8">
                    <h2 class="text-2xl font-bold mb-6 text-center">法律声明</h2>
                    
                    <div class="space-y-4 text-gray-700">
                        <p>本网站（应用宝盒）仅为用户提供便捷的官方应用程序下载链接导航服务，不代表任何应用程序的官方立场，也不与任何应用程序开发商有任何关联。</p>
                        
                        <p>本网站展示的所有应用程序名称、图标、商标等均为其各自所有者的财产，本网站仅出于识别目的而使用，不构成任何形式的侵权。</p>
                        
                        <p>所有应用程序的下载链接均指向各应用官方网站或官方应用商店，本网站不存储、不分发任何应用程序安装文件，不对应用程序的内容和安全性承担任何责任。</p>
                        
                        <p>用户通过本网站访问和下载应用程序时，应遵守各应用程序的用户协议和隐私政策，以及相关法律法规的规定。</p>
                        
                        <p>如任何单位或个人认为本网站提供的链接可能侵犯其合法权益，请及时与我们联系，我们将在核实后尽快处理。</p>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- 页脚 -->
    <footer class="bg-dark text-white py-10">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8 mb-8">
                <div>
                    <div class="flex items-center space-x-2 mb-4">
                        <i class="fa fa-mobile text-2xl text-primary"></i>
                        <h3 class="text-xl font-bold">应用宝盒</h3>
                    </div>
                    <p class="text-gray-400 mb-4">安全、便捷的官方应用下载导航平台，聚合常用手机应用最新版本。</p>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-primary transition-colors">
                            <i class="fa fa-weibo text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-primary transition-colors">
                            <i class="fa fa-wechat text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-primary transition-colors">
                            <i class="fa fa-github text-xl"></i>
                        </a>
                    </div>
                </div>
                
                <div>
                    <h4 class="text-lg font-semibold mb-4">快速链接</h4>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">首页</a></li>
                        <li><a href="#apps" class="text-gray-400 hover:text-white transition-colors">应用列表</a></li>
                        <li><a href="#categories" class="text-gray-400 hover:text-white transition-colors">分类浏览</a></li>
                        <li><a href="#stats" class="text-gray-400 hover:text-white transition-colors">下载统计</a></li>
                    </ul>
                </div>
                
                <div>
                    <h4 class="text-lg font-semibold mb-4">法律信息</h4>
                    <ul class="space-y-2">
                        <li><a href="#disclaimer" class="text-gray-400 hover:text-white transition-colors">法律声明</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">隐私政策</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用条款</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">联系我们</a></li>
                    </ul>
                </div>
                
                <div>
                    <h4 class="text-lg font-semibold mb-4">订阅更新</h4>
                    <p class="text-gray-400 mb-4">获取最新应用更新通知</p>
                    <div class="flex">
                        <input type="email" placeholder="您的邮箱地址" class="px-4 py-2 rounded-l-lg w-full focus:outline-none text-dark">
                        <button class="bg-primary hover:bg-primary/90 px-4 py-2 rounded-r-lg transition-colors">
                            <i class="fa fa-paper-plane"></i>
                        </button>
                    </div>
                </div>
            </div>
            
            <div class="border-t border-gray-800 pt-6 text-center text-gray-500 text-sm">
                <p>© 2025 应用宝盒 - 仅提供官方应用下载链接导航服务</p>
            </div>
        </div>
    </footer>

    <!-- 返回顶部按钮 -->
    <button id="back-to-top" class="fixed bottom-6 right-6 bg-primary hover:bg-primary/90 text-white w-12 h-12 rounded-full flex items-center justify-center shadow-lg transition-all opacity-0 invisible">
        <i class="fa fa-arrow-up"></i>
    </button>

    <!-- JavaScript -->
    <script>
        // 应用数据
        const appsData = [
            {
                id: 1,
                name: "微信",
                icon: "https://picsum.photos/seed/wechat/100",
                description: "全方位的社交与通讯工具，连接你我",
                version: "8.0.45",
                updateDate: "2025-08-20",
                downloads: 356240,
                category: "social",
                officialUrl: "https://weixin.qq.com/",
                platform: ["android", "ios"]
            },
            {
                id: 2,
                name: "QQ",
                icon: "https://picsum.photos/seed/qq/100",
                description: "年轻人喜爱的社交平台，多样互动方式",
                version: "9.9.9",
                updateDate: "2025-08-18",
                downloads: 289150,
                category: "social",
                officialUrl: "https://im.qq.com/",
                platform: ["android", "ios"]
            },
            {
                id: 3,
                name: "支付宝",
                icon: "https://picsum.photos/seed/alipay/100",
                description: "安全便捷的移动支付与生活服务平台",
                version: "10.5.30",
                updateDate: "2025-08-22",
                downloads: 245680,
                category: "shopping",
                officialUrl: "https://www.alipay.com/",
                platform: ["android", "ios"]
            },
            {
                id: 4,
                name: "抖音",
                icon: "https://picsum.photos/seed/douyin/100",
                description: "记录美好生活的短视频平台",
                version: "25.8.0",
                updateDate: "2025-08-25",
                downloads: 421560,
                category: "entertainment",
                officialUrl: "https://www.douyin.com/",
                platform: ["android", "ios"]
            },
            {
                id: 5,
                name: "淘宝",
                icon: "https://picsum.photos/seed/taobao/100",
                description: "综合网购平台，海量商品任你选",
                version: "10.12.0",
                updateDate: "2025-08-15",
                downloads: 198750,
                category: "shopping",
                officialUrl: "https://www.taobao.com/",
                platform: ["android", "ios"]
            },
            {
                id: 6,
                name: "京东",
                icon: "https://picsum.photos/seed/jd/100",
                description: "专业的综合网上购物商城",
                version: "12.3.0",
                updateDate: "2025-08-17",
                downloads: 156230,
                category: "shopping",
                officialUrl: "https://www.jd.com/",
                platform: ["android", "ios"]
            },
            {
                id: 7,
                name: "百度",
                icon: "https://picsum.photos/seed/baidu/100",
                description: "智能搜索，让信息触手可及",
                version: "13.8.0",
                updateDate: "2025-08-21",
                downloads: 187620,
                category: "tools",
                officialUrl: "https://www.baidu.com/",
                platform: ["android", "ios"]
            },
            {
                id: 8,
                name: "高德地图",
                icon: "https://picsum.photos/seed/amap/100",
                description: "专业的手机地图，导航更精准",
                version: "12.1.0",
                updateDate: "2025-08-14",
                downloads: 145890,
                category: "tools",
                officialUrl: "https://www.amap.com/",
                platform: ["android", "ios"]
            },
            {
                id: 9,
                name: "腾讯视频",
                icon: "https://picsum.photos/seed/tencentvideo/100",
                description: "海量影视内容，高清流畅播放",
                version: "11.8.0",
                updateDate: "2025-08-24",
                downloads: 210350,
                category: "entertainment",
                officialUrl: "https://v.qq.com/",
                platform: ["android", "ios"]
            },
            {
                id: 10,
                name: "爱奇艺",
                icon: "https://picsum.photos/seed/iqiyi/100",
                description: "优质视频娱乐平台，精彩内容不断",
                version: "14.6.0",
                updateDate: "2025-08-19",
                downloads: 178450,
                category: "entertainment",
                officialUrl: "https://www.iqiyi.com/",
                platform: ["android", "ios"]
            },
            {
                id: 11,
                name: "网易云音乐",
                icon: "https://picsum.photos/seed/neteasemusic/100",
                description: "发现好音乐，听见好时光",
                version: "9.8.0",
                updateDate: "2025-08-23",
                downloads: 165980,
                category: "entertainment",
                officialUrl: "https://music.163.com/",
                platform: ["android", "ios"]
            },
            {
                id: 12,
                name: "微博",
                icon: "https://picsum.photos/seed/weibo/100",
                description: "发现新鲜事，分享生活点滴",
                version: "13.6.0",
                updateDate: "2025-08-16",
                downloads: 201560,
                category: "social",
                officialUrl: "https://weibo.com/",
                platform: ["android", "ios"]
            },
            {
                id: 13,
                name: "哔哩哔哩",
                icon: "https://picsum.photos/seed/bilibili/100",
                description: "二次元文化社区，海量原创内容",
                version: "7.5.0",
                updateDate: "2025-08-26",
                downloads: 198750,
                category: "entertainment",
                officialUrl: "https://www.bilibili.com/",
                platform: ["android", "ios"]
            },
            {
                id: 14,
                name: "小红书",
                icon: "https://picsum.photos/seed/xiaohongshu/100",
                description: "生活方式分享社区，发现美好事物",
                version: "7.8.0",
                updateDate: "2025-08-13",
                downloads: 156320,
                category: "social",
                officialUrl: "https://www.xiaohongshu.com/",
                platform: ["android", "ios"]
            },
            {
                id: 15,
                name: "美团",
                icon: "https://picsum.photos/seed/meituan/100",
                description: "吃喝玩乐一站式生活服务平台",
                version: "12.5.20",
                updateDate: "2025-08-27",
                downloads: 234560,
                category: "life",
                officialUrl: "https://www.meituan.com/",
                platform: ["android", "ios"]
            },
            {
                id: 16,
                name: "饿了么",
                icon: "https://picsum.photos/seed/eleme/100",
                description: "专业的外卖服务平台，美食送到家",
                version: "10.11.0",
                updateDate: "2025-08-12",
                downloads: 187650,
                category: "life",
                officialUrl: "https://www.ele.me/",
                platform: ["android", "ios"]
            },
            {
                id: 17,
                name: "滴滴出行",
                icon: "https://picsum.photos/seed/didi/100",
                description: "便捷的出行平台，一键叫车",
                version: "6.5.0",
                updateDate: "2025-08-28",
                downloads: 145620,
                category: "life",
                officialUrl: "https://www.didiglobal.com/",
                platform: ["android", "ios"]
            },
            {
                id: 18,
                name: "钉钉",
                icon: "https://picsum.photos/seed/dingding/100",
                description: "高效办公沟通平台，提升团队协作",
                version: "7.3.0",
                updateDate: "2025-08-11",
                downloads: 123450,
                category: "tools",
                officialUrl: "https://www.dingtalk.com/",
                platform: ["android", "ios"]
            },
            {
                id: 19,
                name: "拼多多",
                icon: "https://picsum.photos/seed/pinduoduo/100",
                description: "社交电商平台，拼团更优惠",
                version: "6.8.0",
                updateDate: "2025-08-10",
                downloads: 210980,
                category: "shopping",
                officialUrl: "https://www.pinduoduo.com/",
                platform: ["android", "ios"]
            },
            {
                id: 20,
                name: "优酷",
                icon: "https://picsum.photos/seed/youku/100",
                description: "海量影视内容，高清品质享受",
                version: "10.9.0",
                updateDate: "2025-08-09",
                downloads: 165430,
                category: "entertainment",
                officialUrl: "https://www.youku.com/",
                platform: ["android", "ios"]
            },
            {
                id: 21,
                name: "酷狗音乐",
                icon: "https://picsum.photos/seed/kugou/100",
                description: "高品质音乐播放，百万曲库任你听",
                version: "11.2.0",
                updateDate: "2025-08-08",
                downloads: 132560,
                category: "entertainment",
                officialUrl: "https://www.kugou.com/",
                platform: ["android", "ios"]
            },
            {
                id: 22,
                name: "快手",
                icon: "https://picsum.photos/seed/kuaishou/100",
                description: "记录和分享生活的短视频平台",
                version: "11.6.0",
                updateDate: "2025-08-07",
                downloads: 245670,
                category: "entertainment",
                officialUrl: "https://www.kuaishou.com/",
                platform: ["android", "ios"]
            }
        ];

        // DOM 元素
        const appContainer = document.querySelector('#apps .grid');
        const categoryBtns = document.querySelectorAll('.category-btn');
        const mobileMenuBtn = document.getElementById('mobile-menu-btn');
        const mobileMenu = document.getElementById('mobile-menu');
        const navbar = document.getElementById('navbar');
        const backToTopBtn = document.getElementById('back-to-top');
        const loadMoreBtn = document.getElementById('load-more');
        
        // 初始化显示的应用数量
        let displayedApps = 12;
        
        // 渲染应用卡片
        function renderApps(filteredApps = null) {
            const appsToRender = filteredApps || appsData.slice(0, displayedApps);
            appContainer.innerHTML = '';
            
            appsToRender.forEach(app => {
                const appCard = document.createElement('div');
                appCard.className = 'bg-white rounded-xl shadow-sm overflow-hidden card-hover app-card';
                appCard.setAttribute('data-category', app.category);
                
                // 格式化下载量
                const formattedDownloads = app.downloads.toLocaleString();
                
                appCard.innerHTML = `
                    <div class="p-5">
                        <div class="flex items-start mb-4">
                            <img src="${app.icon}" alt="${app.name}图标" class="w-14 h-14 rounded-lg object-cover mr-4">
                            <div>
                                <h3 class="font-bold text-lg">${app.name}</h3>
                                <p class="text-gray-500 text-sm">版本 ${app.version}</p>
                                <div class="flex items-center mt-1 text-sm text-gray-500">
                                    <i class="fa fa-download mr-1 text-primary"></i>
                                    <span>${formattedDownloads} 次下载</span>
                                </div>
                            </div>
                        </div>
                        
                        <p class="text-gray-600 text-sm mb-4 line-clamp-2">${app.description}</p>
                        
                        <div class="flex items-center justify-between text-xs text-gray-500 mb-4">
                            <span>更新于 ${app.updateDate}</span>
                            <div class="flex space-x-1">
                                ${app.platform.includes('android') ? '<span class="bg-green-100 text-green-800 px-2 py-0.5 rounded">Android</span>' : ''}
                                ${app.platform.includes('ios') ? '<span class="bg-blue-100 text-blue-800 px-2 py-0.5 rounded">iOS</span>' : ''}
                            </div>
                        </div>
                        
                        <a href="${app.officialUrl}" target="_blank" rel="noopener noreferrer" class="block w-full bg-primary hover:bg-primary/90 text-white text-center py-2 rounded-lg transition-colors font-medium">
                            <i class="fa fa-external-link mr-1"></i> 官方下载
                        </a>
                    </div>
                `;
                
                appContainer.appendChild(appCard);
            });
            
            // 检查是否需要显示加载更多按钮
            if (filteredApps || displayedApps >= appsData.length) {
                loadMoreBtn.classList.add('hidden');
            } else {
                loadMoreBtn.classList.remove('hidden');
            }
        }
        
        // 初始化图表
        function initChart() {
            const ctx = document.getElementById('downloadChart').getContext('2d');
            
            // 生成近30天的日期和模拟数据
            const dates = [];
            const downloads = [];
            
            for (let i = 29; i >= 0; i--) {
                const date = new Date();
                date.setDate(date.getDate() - i);
                dates.push(`${date.getMonth() + 1}/${date.getDate()}`);
                
                // 生成模拟下载数据，在10000-30000之间波动
                const base = 20000;
                const fluctuation = Math.floor(Math.random() * 10000) - 5000;
                downloads.push(base + fluctuation);
            }
            
            new Chart(ctx, {
                type: 'line',
                data: {
                    labels: dates,
                    datasets: [{
                        label: '每日下载量',
                        data: downloads,
                        borderColor: '#3B82F6',
                        backgroundColor: 'rgba(59, 130, 246, 0.1)',
                        tension: 0.4,
                        fill: true
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            display: false
                        },
                        tooltip: {
                            mode: 'index',
                            intersect: false
                        }
                    },
                    scales: {
                        y: {
                            beginAtZero: false,
                            grid: {
                                color: 'rgba(0, 0, 0, 0.05)'
                            }
                        },
                        x: {
                            grid: {
                                display: false
                            }
                        }
                    },
                    interaction: {
                        mode: 'nearest',
                        axis: 'x',
                        intersect: false
                    }
                }
            });
        }
        
        // 分类过滤
        function filterApps(category) {
            if (category === 'all') {
                renderApps(appsData.slice(0, displayedApps));
            } else {
                const filteredApps = appsData.filter(app => app.category === category);
                renderApps(filteredApps);
            }
            
            // 更新活跃按钮样式
            categoryBtns.forEach(btn => {
                if (btn.getAttribute('data-category') === category) {
                    btn.classList.add('ring-2', 'ring-primary');
                } else {
                    btn.classList.remove('ring-2', 'ring-primary');
                }
            });
            
            // 滚动到应用列表
            document.getElementById('apps').scrollIntoView({ behavior: 'smooth' });
        }
        
        // 数字动画效果
        function animateValue(id, start, end, duration) {
            const obj = document.getElementById(id);
            if (!obj) return;
            
            let startTimestamp = null;
            const step = (timestamp) => {
                if (!startTimestamp) startTimestamp = timestamp;
                const progress = Math.min((timestamp - startTimestamp) / duration, 1);
                
                // 根据ID格式化数字
                if (id === 'total-downloads' || id === 'active-users') {
                    obj.innerHTML = Math.floor(progress * (end - start) + start).toLocaleString();
                } else {
                    obj.innerHTML = Math.floor(progress * (end - start) + start);
                }
                
                if (progress < 1) {
                    window.requestAnimationFrame(step);
                }
            };
            window.requestAnimationFrame(step);
        }
        
        // 监听滚动事件
        function handleScroll() {
            // 导航栏效果
            if (window.scrollY > 50) {
                navbar.classList.add('py-2', 'shadow');
                navbar.classList.remove('py-3');
            } else {
                navbar.classList.add('py-3');
                navbar.classList.remove('py-2', 'shadow');
            }
            
            // 返回顶部按钮
            if (window.scrollY > 500) {
                backToTopBtn.classList.remove('opacity-0', 'invisible');
                backToTopBtn.classList.add('opacity-100', 'visible');
            } else {
                backToTopBtn.classList.add('opacity-0', 'invisible');
                backToTopBtn.classList.remove('opacity-100', 'visible');
            }
            
            // 检测元素是否在视口中，用于动画
            const statsElements = document.querySelectorAll('#stats .card-hover');
            statsElements.forEach(el => {
                const rect = el.getBoundingClientRect();
                if (rect.top < window.innerHeight && rect.bottom >= 0) {
                    el.classList.add('animate-fadeIn');
                }
            });
        }
        
        // 事件监听
        document.addEventListener('DOMContentLoaded', () => {
            // 初始渲染应用
            renderApps();
            
            // 初始化图表
            initChart();
            
            // 数字动画
            setTimeout(() => {
                animateValue('total-apps', 0, 22, 1500);
                animateValue('total-downloads', 0, 1245890, 2000);
                animateValue('today-updates', 0, 5, 1500);
                animateValue('active-users', 0, 45682, 2000);
            }, 500);
            
            // 分类按钮点击事件
            categoryBtns.forEach(btn => {
                btn.addEventListener('click', () => {
                    const category = btn.getAttribute('data-category');
                    filterApps(category);
                });
            });
            
            // 移动端菜单
            mobileMenuBtn.addEventListener('click', () => {
                mobileMenu.classList.toggle('hidden');
            });
            
            // 返回顶部
            backToTopBtn.addEventListener('click', () => {
                window.scrollTo({
                    top: 0,
                    behavior: 'smooth'
                });
            });
            
            // 加载更多
            loadMoreBtn.addEventListener('click', () => {
                displayedApps += 8;
                if (displayedApps > appsData.length) {
                    displayedApps = appsData.length;
                }
                renderApps();
                
                // 滚动到新加载的内容
                const appCards = document.querySelectorAll('.app-card');
                if (appCards.length >= displayedApps) {
                    appCards[displayedApps - 8].scrollIntoView({ behavior: 'smooth', block: 'nearest' });
                }
            });
            
            // 平滑滚动
            document.querySelectorAll('a[href^="#"]').forEach(anchor => {
                anchor.addEventListener('click', function(e) {
                    e.preventDefault();
                    const targetId = this.getAttribute('href');
                    if (targetId === '#') return;
                    
                    const targetElement = document.querySelector(targetId);
                    if (targetElement) {
                        targetElement.scrollIntoView({
                            behavior: 'smooth'
                        });
                        
                        // 关闭移动菜单
                        if (!mobileMenu.classList.contains('hidden')) {
                            mobileMenu.classList.add('hidden');
                        }
                    }
                });
            });
            
            // 监听滚动
            window.addEventListener('scroll', handleScroll);
        });
    </script>
</body>
</html>
